local util = {} local ts = game:GetService("TweenService") function util.Create(ty) return function(data) local obj = Instance.new(ty) for k, v in pairs(data) do if type(k) == 'number' then v.Parent = obj else obj[k] = v end end return obj end end local env = getfenv(0) local quacks = {4340107935, 4340109484, 4340110617} do --epick duc local handle = util.Create('Part'){ Size = Vector3.new(1, 1.2, 1); Color = Color3.new(245, 205, 48); Name = "Handle"; } local mesh = util.Create('SpecialMesh') { Parent = handle; MeshId = "rbxassetid://9419831"; TextureId = "rbxassetid://9419827"; } local tool = util.Create('Tool'){ Parent = env.owner.Backpack; Name = 'Rubber Ducky'; TextureId = "rbxassetid://8572258290"; } handle.Parent = tool; --// local int = 0 local allow = math.random(4, 12) tool.Activated:Connect(function() int = int + math.random(1, 2) if int > allow then int = 0; allow = math.random(4, 12) task.spawn(function() local minihandle = util.Create('Part'){ Size = Vector3.new(1, 1.2, 1) * 0.45; Color = Color3.new(245, 205, 48); Name = "MiniDuck"; Parent = script; } local mesh = util.Create('SpecialMesh') { Parent = minihandle; Scale = Vector3.new(1, 1, 1) * 0.45; MeshId = "rbxassetid://9419831"; TextureId = "rbxassetid://9419827"; } minihandle.CFrame = handle.CFrame; minihandle:SetNetworkOwner(env.owner) minihandle.AssemblyLinearVelocity = (env.owner.Character.HumanoidRootPart.CFrame.LookVector * math.random(7, 15)) local quack = util.Create('Sound'){ SoundId = "rbxassetid://"..(quacks[math.random(1, #quacks)]); Volume = 1; Pitch = 1.8 * Random.new():NextNumber(0.985, 1.05); Parent = minihandle; } quack:Play() quack.Ended:Connect(function() quack:Destroy() end) game:GetService("Debris"):AddItem(minihandle, 12) end) end local tween = ts:Create(mesh, TweenInfo.new(0.5, Enum.EasingStyle.Back), {Scale = Vector3.new(1, 0.6, 1)}) tween:Play() local quack = util.Create('Sound'){ SoundId = "rbxassetid://"..(quacks[math.random(1, #quacks)]); Volume = 1; Pitch = 1.3 * Random.new():NextNumber(0.985, 1.05); Parent = handle; } quack:Play() quack.Ended:Connect(function() quack:Destroy() end) task.delay(0.125, function() local tween = ts:Create(mesh, TweenInfo.new(1, Enum.EasingStyle.Elastic), {Scale = Vector3.new(1, 1, 1)}) tween:Play() end) end) end do --evil duc local handle = util.Create('Part'){ Size = Vector3.new(1, 1.2, 1); Color = Color3.new(245, 205, 48); Name = "Handle"; } local mesh = util.Create('SpecialMesh') { Parent = handle; MeshId = "http://www.roblox.com/asset/?id=14810664"; TextureId = "http://www.roblox.com/asset/?id=14810649"; Offset = Vector3.new(0, -0.1, 0); } local tool = util.Create('Tool'){ Parent = env.owner.Backpack; Name = 'Evil Rubber Ducky'; TextureId = "http://www.roblox.com/asset/?id=161891919"; } handle.Parent = tool; --// tool.Activated:Connect(function() local tween = ts:Create(mesh, TweenInfo.new(0.5, Enum.EasingStyle.Back), {Scale = Vector3.new(1, Random.new():NextNumber(0.6,1.3) + 0.4, 1)}) tween:Play() local quack = util.Create('Sound'){ SoundId = "rbxassetid://"..(quacks[math.random(1, #quacks)]); Volume = 1; Pitch = 1 * Random.new():NextNumber(0.985, 1.05); Parent = handle; } quack:Play() Instance.new("PitchShiftSoundEffect", quack).Octave = 0.6 quack.Ended:Connect(function() quack:Destroy() end) task.delay(0.125, function() local tween = ts:Create(mesh, TweenInfo.new(1, Enum.EasingStyle.Elastic), {Scale = Vector3.new(1, 1, 1)}) tween:Play() end) end) end